//
//  NSTimer+ZZUtil.m
//  ZZKitDemo
//
//  Created by hfzhangzhang on 2018/8/6.
//  Copyright © 2018年 hfzhangzhang. All rights reserved.
//

#import "NSTimer+ZZUtil.h"

@implementation NSTimer (ZZUtil)

@end

@implementation NSTimer (restart)

- (void)pause {
    if ([self isValid]) {
        [self setFireDate:[NSDate distantFuture]];
    }
}

- (void)restart {
    if ([self isValid]) {
        [self setFireDate:[NSDate date]];
    }
}

- (void)restartAfterTimeInterval:(NSTimeInterval)interval {
    if ([self isValid]) {
        [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
    }
}

@end
